package com.usian.search.controller;

import com.usian.api.search.SearchControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.search.dto.UserSearchDto;
import com.usian.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/article/search")
public class SearchController implements SearchControllerApi {

    @Autowired
    private SearchService searchService;

    @Override
    @PostMapping("/search")
    public ResponseResult search(@RequestBody UserSearchDto dto) {
        return searchService.search(dto);
    }
}
